package com.lesso.cyg.sunflower.infra.assembler;

import com.lesso.cyg.sunflower.model.Device;
import com.lesso.cyg.sunflower.pojo.dto.DeviceDTO;
import com.lesso.cyg.sunflower.pojo.vo.DeviceVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface DeviceAssembler {
    DeviceAssembler INSTANCE = Mappers.getMapper(DeviceAssembler.class);

    Device dtoToEntity(DeviceDTO dto);

    /**
     * 实体转DTO
     */
    DeviceVO entityToVO(Device device);

    /**
     * 实体列表转DTO列表
     */
    List<DeviceVO> entityListToVOList(List<Device> devices);
}